#pragma once
#include "Physics/core.h"
#include "Physics/rigidbody.h"
#include "Physics/collide_fine.h"
#include "d3dUtil.h"
#include "RenderInfo.h"
#include "GameObject.h"
#include "ObjectTypes.h"

#define BOX_DEFAULTW	3
#define BOX_DEFAULTH	3
#define BOX_DEFAULTD	3

class Box :
	public physics::CollisionBox, public GameObject
{
public:
	Box(float width = BOX_DEFAULTW, float height = BOX_DEFAULTH, float depth = BOX_DEFAULTD, ObjectMaterial material = OBJECTMATERIAL_DEFAULT);
	virtual ~Box(void);

	void Render(RenderInfo ri);
	void Update(float dt);

	physics::RigidBody* GetBody(void)
	{
		return body;
	}

	int GetHP()
	{
		return mHealth;
	}

	void SetHP(int h)
	{
		mHealth = h;
	}

	bool HasHealth(void)
	{
		return mHasHealth;
	}

	bool mHasHealth; // can be accessed publically

	ObjectMaterial GetMaterial(void)
	{
		return mMaterial;
	}

	UINT GetType(void)
	{
		return 0;
	}

	void ToggleShowHealth(void)
	{
		if (HasHealth())
		{
			mShowHealth = !mShowHealth;
		}
	}

private:
	ObjectType			mObjectType;
	D3DXMATRIX			mScale;
	int					mHealth;
	ObjectMaterial		mMaterial;
	bool				mShowHealth;
};

